package cn.tedu.vehicle_rental.user.controller;

import cn.tedu.vehicle_rental.basic.JsonResult;
import cn.tedu.vehicle_rental.user.pojo.param.UserParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@RequestMapping("/user")
@Api(tags = "用户模块")
public class UserController {
    /**
     * 用户注册模块
     * @param userParam
     * @return
     */
    @ApiOperation("用户注册")
    @PostMapping("register")
    public JsonResult register(@RequestBody UserParam userParam) {
        log.info("用户注册");
        return JsonResult.ok("注册成功");
    }

    /**
     *用户登录
     * @param userParam
     * @return
     */
    @ApiOperation("用户登录")
    @PostMapping("login")
    public JsonResult login(@RequestBody UserParam userParam) {
        log.info("用户登录");
        return JsonResult.ok("登录成功");
    }

    /**
     * 修改个人信息
     * @param userId
     * @return
     */

    @ApiOperation("修改个人信息")
    @PostMapping("update")
    public JsonResult update(Integer userId){
        return JsonResult.ok("修改成功");
    }
}
